package com.example.project.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.project.entity.Museum;
import com.example.project.mapper.MuseumMapper;

/**
 * 体验馆信息Controller
 *
 * @author changyao
 * @date 2024-12-23
 */
@RestController
@RequestMapping("/project/museum")
public class MuseumController
{
    @Autowired
    private MuseumMapper museumMapper;

    /**
     * 查询体验馆信息列表
     */
    @GetMapping("/list")
    public List<Museum> list()
    {
        QueryWrapper<Museum> queryWrapper=new QueryWrapper<>();
        return museumMapper.selectList(queryWrapper);
    }




    /**
     * 获取体验馆信息详细信息
     */
    @PostMapping("/detil")
    public Museum getInfo(@RequestBody Museum museum)
    {
        return museumMapper.selectById(museum);
    }


    /**
     * 新增体验馆信息
     */
    @PostMapping("/add")
    public int add(@RequestBody Museum museum)
    {
        return museumMapper.insert(museum);
    }

    /**
     * 修改体验馆信息
     */
    @PostMapping("/edit")
    public int edit(@RequestBody Museum museum)
    {
        return museumMapper.updateById(museum);
    }

    /**
     * 删除体验馆信息
     */
	@PostMapping("/del")
    public int remove(@RequestBody Museum museum)
    {
        return museumMapper.deleteById(museum);
    }
}
